﻿@{
    ViewBag.Title = "保存信息表";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
@model MiniWeb.Web.Controllers.Admin.NewsManager.ViewModels.SaveNews
<link href="../../Scripts/jquery-validation-engine/css/template.css" rel="stylesheet"
    type="text/css" />
<link href="../../Scripts/jquery-validation-engine/css/validationEngine.jquery.css"
    rel="stylesheet" type="text/css" />
<link href="../../Scripts/kindeditor-4.1.10/themes/default/default.css" rel="stylesheet"
    type="text/css" />
<script src="../../Scripts/jquery-1.7.1.min.js" type="text/javascript"></script>
<script src="../../Scripts/jquery-validation-engine/js/jquery.validationEngine.js"
    type="text/javascript"></script>
<script src="../../Scripts/jquery-validation-engine/js/languages/jquery.validationEngine-zh_CN.js"
    type="text/javascript"></script>
<script src="../../Scripts/kindeditor-4.1.10/kindeditor-min.js" type="text/javascript"></script>
<script src="../../Scripts/My97DatePicker/WdatePicker.js" type="text/javascript"></script>
<script type="text/javascript">
    $(function () {
     
        $("#form1").validationEngine();
                var editor = KindEditor.create('textarea[name="Content"]', {
            uploadJson: "@Url.Action("SaveSystemImage", "Uploads")",
            syncType: '',
           
            afterBlur: function() {
                editor.sync();
            }
        });
        
        loadServer();
        $("#ParentType").change(function () {
            loadServer();
        });
        function loadServer() {
            var gameid = $('#ParentType');
            var serverlist = $('#NewType');

            var gameid = gameid.val();
            serverlist.empty();

            $.getJSON('@Url.Action("GetNewsTypeList", "NewsTypeManager")', { typeid: gameid }, function (data) {
                $.each(data, function (i, item) {
                    $("<option></option>").val(item["Value"]).text(item["Text"]).appendTo(serverlist);
                });
            });
        }
    })
</script>
<div class="wrap">
    <div class="right_box_card">
        <ul>
            <li class="right_box_card1"><a href="#">保存信息表</a></li>
        </ul>
    </div>
    <div>
        <div style="color: red;">
        </div>
        @using (Html.BeginForm("Save", "NewsManager", FormMethod.Post, new { @class = "formular", id = "form1", enctype = "multipart/form-data" }))
        {
            @Html.HiddenFor(c => c.ID)
            <table class="enter_tab" width="100%" border="0" cellpadding="0" cellspacing="0">
                <tr height="40">
                    <td class="entry_tab_td1">@Html.LabelFor(c => c.ParentType)
                    </td>
                    <td class="entry_tab_td2">
                        @Html.DropDownList("ParentType", ViewData["roottypelist"] as List<SelectListItem>, new { @class = "text-input" })&nbsp;&nbsp;
                    </td>
                </tr>
                <tr height="40">
                    <td class="entry_tab_td1">@Html.LabelFor(c => c.NewType)
                    </td>
                    <td class="entry_tab_td2">
                        @Html.DropDownList("NewType", new List<SelectListItem>())
                    </td>
                </tr>
                <tr height="40">
                    <td class="entry_tab_td1">@Html.LabelFor(c => c.Title)
                    </td>
                    <td class="entry_tab_td2">
                        @Html.TextBoxFor(c => c.Title, new { @class = "validate[required] text-input", style = "" })
                    </td>
                </tr>
                 <tr height="40">
                    <td class="entry_tab_td1">@Html.LabelFor(c => c.ShortDes)
                    </td>
                    <td class="entry_tab_td2">
                        @Html.TextAreaFor(c => c.ShortDes, new { @class = "validate[required] text-input", style = "width:650px; height:50px;" })
                    </td>
                </tr>

                <tr height="40">
                    <td class="entry_tab_td1">@Html.LabelFor(c => c.Content)
                    </td>
                    <td class="entry_tab_td2">
                        @Html.TextAreaFor(c => c.Content, new { @class = "validate[required] text-input", @style = "width:650px;height:400px;" })
                    </td>
                </tr>
                <tr height="40">
                    <td class="entry_tab_td1">@Html.LabelFor(c => c.IsHot)
                    </td>
                    <td class="entry_tab_td2">
                        @Html.CheckBoxFor(c => c.IsHot)
                    </td>
                </tr>
                <tr>
                    <td>
                    </td>
                    <td style="line-height: 30px;">@Html.ValidationSummary()
                    </td>
                </tr>
                <tr>
                    <td>
                        <input type="submit" value="保存" class="submit" style="width: 100px; height: 30px;" />
                    </td>
                    <td>
                    </td>
                </tr>
            </table> 
        }
    </div>
</div>
